package com.xiaoxi.open.design.structural.compositepattern.composite.tree;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.compositemode.composite
 * @ClassName File
 * @Description TODO
 * @Date 2023/3/14 10:04
 * @Version 1.0
 */
public class File implements Entry {

    private final String name;
    private final int size;

    public File(String name, int size) {
        this.name = name;
        this.size = size;
    }

    @Override
    public void add(Entry entry) {

    }

    @Override
    public void printList(String prefix) {
        System.out.println(prefix + "/" + name + " ( " + getSize() + " )");
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getSize() {
        return size;
    }


}
